package com.peanut.baby.model;

import com.google.gson.annotations.SerializedName;

import java.io.Serializable;

/**
 * Created by anonymouslystudio on 2017/7/10.
 */

public class User implements Serializable {
    public static final int USER_TYPE_NORMAL = 1;
    public static final int USER_TYPE_DOCTOR = 2;
    public static final int USER_TYPE_EXPERT = 3;


    /** 男 */
    public static final String GENDER_MALE = "1";
    /** 女 */
    public static final String GENDER_FEMALE = "0";

    @SerializedName(value = "id", alternate = {"userId"})
    public String userId;
    @SerializedName("nickname")
    public String nickname;
    @SerializedName("realName")
    public String realName;
    @SerializedName("userType")
    public int userType  = User.USER_TYPE_NORMAL;

    @SerializedName("summary")
    public String summary;

    @SerializedName("hospital")
    public String hospital;
    @SerializedName("department")
    public String department;
    @SerializedName("specialty")
    public String specialty;
    @SerializedName("openid")
    public String openid;

    public String type;
    @SerializedName("userToken")
    public String userToken;
    @SerializedName("gender")
    public String gender;
    @SerializedName("signStr")
    public String sign = "";
    @SerializedName("mobile")
    public String mobile;
    @SerializedName("avatar")
    public String avatar;
    @SerializedName(value = "userPoint", alternate = {"totalPoint"})
    public int    userPoint;
    @SerializedName("fansCount")
    public int    fansCount = 0;
    @SerializedName("postCount")
    public int    postCount = 0;
    @SerializedName("replyCount")
    public int    replyCount = 0;
    @SerializedName("answerCount")      //我的问答数量
    public int    answerCount = 0;
    @SerializedName("liveCount")      //我的问答数量
    public int    liveCount = 0;
    @SerializedName("concernCount")
    public int    concernCount = 0;
    @SerializedName("isConcerned")
    public int    isConcerned;
    @SerializedName("untilNow")
    public int    untilNow = 0;

    @SerializedName("wdUserid")
    public String    wdUserid = "";

    @SerializedName("age")
    public int age;
    @SerializedName("province")
    public String province;
    @SerializedName("userStatus")
    public int userStatus;

    public void joinExtraInfo(User propUser){
        gender = propUser.gender;
        avatar = propUser.avatar;
        realName = propUser.realName;
        nickname = propUser.nickname;
        userPoint = propUser.userPoint;
        concernCount = propUser.concernCount;
        fansCount = propUser.fansCount;
        isConcerned = propUser.isConcerned;
        untilNow = propUser.untilNow;
        age = propUser.age;
        province = propUser.province;
        userStatus = propUser.userStatus;
    }
    public boolean isNormalUser(){
        return userType == USER_TYPE_NORMAL;
    }
    public boolean canAnswerQuestion(){
        return userType == USER_TYPE_DOCTOR
                || userType == USER_TYPE_EXPERT;
    }
}
